#include "testlib.h"

int main( int argc, char *argv[] ) {

  registerTestlibCmd(argc, argv);

  int n = inf.readInt();
  int m = n * 2 + 1;
  std::set<std::pair<int, int> > s;

  for (int p = 0; p < n; p++) {
    int first = ouf.readInt();
    int a = first;
    if (a < 1 || a > m)
       quitf(_wa, "Number %d in wrong range", a);
    for (int i = 1; i < m; i++) {
      int b = (i < m) ? ouf.readInt() : first;
      if (b < 1 || b > m) {
        quitf(_wa, "Number %d in wrong range", b);
      }
      std::pair<int, int> adj = (a < b) ? std::make_pair(a, b): std::make_pair(b, a);
      if (s.count(adj) > 0)
        quitf(_wa, "Duplicate pair <%d, %d> found at line %d", a, b, p + 1);
      s.insert(adj);
      a = b;
    }
  }
//  ouf.seekEof();
  quitf(_ok, "Accepted");
  return 0;
}
